$(function () {
    //  <!-- 左侧分类数据展示 -->
    $.ajax({
        url: '/categories',
        success: function (res) {
            console.log(res, 432);
            var html = template('cate-box', { cateArr: res })
            $('.nav').html(html)
        }
    })

    var  id=new  URLSearchParams(location.search).get('id')
    

    $.ajax({
        url: '/posts/category/'+id,
        success: function (res) {
            console.log(res, 2323);
             var html = template('article-box', { articleArr: res })
             $('.new').html(html)


        }
    })

    /* 点击搜索实现跳转 */
    $('.btnS').click(function(){
        var  keys=$('.keys').val()
        location.href='search.html?key='+keys
        return  false;
    })


})